package com.zheng.mapper;


import com.zheng.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    //登录时查询数据
    public User getUser(@Param("username") String username, @Param("password")String password);
    //插入数据
    public int insertUser(@Param("username") String username, @Param("password")String password
            ,@Param("email") String email,@Param("role") String role,@Param("state") String state);
    public List<User> getAllUser(@Param("username") String username, @Param("pageStart") int pageStart, @Param("pageSize") int pageSize);
    public int getUserCounts(@Param("username") String username);
    public int updateState(Integer id, Boolean state);
    /*插入数据*/
    public int addUser(User user);
    public User getUpdateUser(int id);
    public int editUser(User user);
    public int deleteUser(int id);
}
